package com.allwees.bs.module.oms.rest;


import com.allwees.bs.module.core.annotation.PrintLog;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.core.dynamic.annotation.DynamicInject;
import com.allwees.bs.module.oms.entity.Order;
import com.allwees.bs.module.oms.req.query.OrderQueryReq;
import com.allwees.bs.module.oms.service.GeneralOrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@PrintLog
@RestController
@RequestMapping("/backstage/api/oms/o_order")
public class GeneralOrderApi  extends BaseOrderApi<GeneralOrderService>  {

    @GetMapping("/page")
    @DynamicInject(key = "userUuid",type= DynamicInject.Type.User)
    public R page(Page<Order> page, OrderQueryReq req) {
        QueryWrapper<Order> wrapper = new QueryWrapper<>();
        req.buildQuery(wrapper);
        return super.page(page, req);
    }
}
